function y = trans(para)
% TRANS(PARA)
%   transforms variables from max(unrestricted) 
%   to model(restricted)
%
% case 0, (-inf,inf) 
%   no adjustment needed
%   
% case 1, [a,b]
%   x/sqrt(1+x^2), x unbounded
%   0.5*[ (a+b) + (b-a)*c*x/sqrt(1+c^2*x^2) ]
%
% case 2, (a,inf)
%   exp(x), x unbounded
%   a + exp(c*(x-b))
%
% See also PARA_SPEC.TXT

% June 9, 2002
% Sungbae An

global paraspec_;

y = para;

for i=1:length(para)
    a = paraspec_(i,2);
    b = paraspec_(i,3);
    c = paraspec_(i,4);

    if paraspec_(i,1)==1;
        y(i) = (a+b)/2 + 0.5*(b-a)*c*para(i)/sqrt(1+c^2*para(i)^2);
    elseif paraspec_(i,1)==2;
        y(i) = a + exp(c*(para(i)-b));
    end
end
